<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<%--
  Created by IntelliJ IDEA.
  User: Bronya
  Date: 2022/12/2
  Time: 16:08
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <link rel="stylesheet" href="/css/bookdetail.css">
    <style>

        /* 设置表格边框，单元格的线的粗细，颜色 */
        table,td {
            border: 1px solid black;
        }
        /* 设置 表格边框线与单元格的线折叠*/
        table {
            border-collapse: collapse;
        }
        /* 设置 表格宽度和高度 */

        /* 设置 单元格文本水平和垂直对齐方式 */
        td {
            text-align: center;
            vertical-align: center;
        }
        /* 设置 单元格文本与单元格边框的距离 */
        td {
            padding: 15px;
        }
        th{width: 200px}
    </style>

        <meta charset="utf-8" />
        <title>Read——睁眼看世界</title>
        <link rel="stylesheet" href="/css/bookdetail.css">

</head>


<body>
<div class="header">
    <div class="logo"><a href="/tohome"><img src="/images/logo.jpg" alt="本网站Logo"></a></div>
    <div class="search-box">
        <form method="post" action="/selectbooktohome">
            搜索<input name="name">
        </form>
    </div>
</div>
<div class="nav">
    <ul>
        <li><a href="/tohome">主页</a></li>
        <li><a href="/tofinance">金融</a></li>
        <li><a href="/tohuman">人文社科</a></li>
        <li><a href="/tochildren">儿童读物</a></li>
        <li><a href="/tocomputer">计算机</a></li>
    </ul>
</div>
<table>
    <tr>
        <td>图书名</td>
        <td>数目</td>
        <td>价格</td>
        <td>操作</td>
    </tr>
    <c:forEach items="${carts}" var="cart">
        <c:if test="${cart.price > 0}">
        <tr>
        <td>${cart.name}</td>
        <td>${cart.quantity}</td>
         <td>${cart.price}</td>
            <td>
                <a href="/addone?book_id=${cart.book_id}">数量加一</a>
                <a href="/releaseone?book_id=${cart.book_id}">数量减一</a>
                <a href="/deleteone?book_id=${cart.book_id}">删除</a>
            </td>
        </tr>
        </c:if>
    </c:forEach>
</table>
<h1>总价${total}</h1>
<div class="a25">
    <a href="/topay"><button class="a25color1">结算</button></a>
</div>
</body>
</html>
